<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>02_XHR-XHR状态变化的监听</title>
</head>
<body>

  <script>
     // 1. 创建一个XMLHttpRequest对象
     const xhr = new XMLHttpRequest()

    // 2. 监听请求状态的变化
    xhr.onreadystatechange = function () {
      if (xhr.readyState !== XMLHttpRequest.DONE) return
      console.log(xhr.response);
    }

    // 3. 配置请求信息
    xhr.open('GET', 'http://123.207.32.32:8000/home/multidata')

    // 4. 发送请求
    xhr.send()

  </script>
  
</body>
</html>